<?php

namespace App\Http\Controllers;

use App\Library\Requests\Version\VersionAddRequest;
use App\Library\Service\VersionService;
use Illuminate\Http\JsonResponse;

class VersionController extends BaseController
{
    /**
     * @param VersionService $service
     */
    public function __construct(VersionService $service)
    {
        $this->service = $service;
    }

    /**
     * 获取版本信息
     * @return mixed
     *
     */
    public function info()
    {
        return $this->service->info();
    }

    /**
     * 添加版本信息
     * @param VersionAddRequest $request
     * @return JsonResponse
     *
     */
    public function add(VersionAddRequest $request): JsonResponse
    {
        return $this->service->add($request);
    }
}
